<#include "common/header2.ftl" />
<script type="text/javascript" charset="utf-8" src="/resource/assets/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/resource/assets/ueditor/ueditor.all.min.js"> </script>
<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="/resource/assets/ueditor/lang/zh-cn/zh-cn.js"></script>

</head>
<body data-type="generalComponents">
<#include "common/page_top2.ftl" />
<div class="tpl-page-container tpl-page-header-fixed">
    <#include "common/menu.ftl" />
    <div class="tpl-content-wrapper">
        <div class="tpl-content-page-title">
            Amaze UI 表单
        </div>
        <ol class="am-breadcrumb">
            <li><a href="#" class="am-icon-home">首页</a></li>
            <li><a href="#">表单</a></li>
            <li class="am-active">Amaze UI 表单</li>
        </ol>
        <div class="tpl-portlet-components">
            <div class="portlet-title">
                <div class="caption font-green bold">
                    <span class="am-icon-code"></span> 表单
                </div>
                <div class="tpl-portlet-input tpl-fz-ml">
                    <div class="portlet-input input-small input-inline">
                        <div class="input-icon right">
                            <i class="am-icon-search"></i>
                            <input type="text" class="form-control form-control-solid" placeholder="搜索..."> </div>
                    </div>
                </div>


            </div>

            <div class="tpl-block">

                <div class="am-g">
                    <div class="tpl-form-body tpl-form-line">
                        <form class="am-form tpl-form-line-form"  action="/admin/art/save" method="post" enctype="multipart/form-data" >
                            <input  type="hidden" name="id" value="${data.id}" >
                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">标题 <span class="tpl-form-line-small-title">Title</span></label>
                                <div class="am-u-sm-9">
                                    <input type="text" class="tpl-form-input" name="title" value="${data.title}"  id="user-name" placeholder="请输入标题文字">
                                    <small>请填写标题文字10-20字左右。</small>
                                </div>
                            </div>

                            <!--<div class="am-form-group">-->
                            <!--<label for="user-email" class="am-u-sm-3 am-form-label">发布时间 <span class="tpl-form-line-small-title">Time</span></label>-->
                            <!--<div class="am-u-sm-9">-->
                            <!--<input type="text" class="am-form-field tpl-form-no-bg" placeholder="发布时间" data-am-datepicker="" readonly/>-->
                            <!--<small>发布时间为必填</small>-->
                            <!--</div>-->
                            <!--</div>-->

                            <div class="am-form-group">
                                <label for="category" class="am-u-sm-3 am-form-label">分类 <span class="tpl-form-line-small-title">Category</span></label>
                                <div class="am-u-sm-9">
                                    <select id="category" data-am-selected="{searchBox: ${data.id}}" name="categoryId" >
                                        <option value="0" > 请选择分类 </option>
                                         <#list categories as category >
                                             <option value="${category.id}" >${category.title}</option>
                                         </#list>
                                    </select>
                                </div>
                            </div>

                            <#--<div class="am-form-group">-->
                                <#--<label class="am-u-sm-3 am-form-label">简单介绍 <span class="tpl-form-line-small-title">SEO</span></label>-->
                                <#--<div class="am-u-sm-9">-->
                                    <#--<input type="text" placeholder="输入简单介绍语"  name="introduction" >-->
                                <#--</div>-->
                            <#--</div>-->

                            <div class="am-form-group">
                                <label  class="am-u-sm-3 am-form-label">封面图 <span class="tpl-form-line-small-title">Images</span></label>
                                <div class="am-u-sm-9">
                                    <div class="am-form-group am-form-file">
                                        <div class="tpl-form-file-img">
                                            <!--<img src="../resource/assets/img/a5.png" alt="">-->
                                            <#if  data.thumb?? && data.thumb !="" >
                                                <img src="${data.thumb}" alt="">
                                            </#if>
                                        </div>
                                        <button type="button" class="am-btn am-btn-danger am-btn-sm">
                                            <i class="am-icon-cloud-upload"></i> 添加封面图片</button>
                                            <input id="doc-form-file" type="file" name="file" >
                                    </div>

                                </div>
                            </div>

                            <#--<div class="am-form-group">-->
                                <#--<label for="tags" class="am-u-sm-3 am-form-label">添加标签 <span class="tpl-form-line-small-title">Tags</span></label>-->
                                <#--<div class="am-u-sm-9">-->
                                    <#--<select id="tags" data-am-selected="{searchBox: 1}" name="tag" multiple="multiple">-->
                                        <#--<option value="a">-The.CC</option>-->
                                        <#--<option value="b">夕风色</option>-->
                                        <#--<option value="o">Orange</option>-->
                                    <#--</select>-->
                                <#--</div>-->
                            <#--</div>-->

                            <div class="am-form-group">
                                <label for="user-intro" class="am-u-sm-3 am-form-label">隐藏文章</label>
                                <div class="am-u-sm-9">
                                    <div class="tpl-switch">
                                        <input type="checkbox" class="ios-switch bigswitch tpl-switch-btn" name="status" <#if data.status == 1 >checked</#if>  />
                                        <div class="tpl-switch-btn-view">
                                            <div>
                                            </div>
                                        </div>
                                    </div>

                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-intro" class="am-u-sm-3 am-form-label">文章描述</label>
                                <div class="am-u-sm-9">
                                    <textarea class="" rows="4" id="user-intro" placeholder="请输入文章描述" name="introduction" >${data.introduction}</textarea>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="content" class="am-u-sm-3 am-form-label">文章内容</label>
                                <div class="am-u-sm-9">
                                    <script id="content" type="text/plain" name="content"  >${data.content}</script>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <div class="am-u-sm-9 am-u-sm-push-3">
                                    <button type="submit" class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交</button>
                                </div>
                            </div>
                        </form>

                    </div>
                </div>
            </div>

        </div>
    </div>

</div>

</body>
<script src="/resource/assets/js/jquery.min.js"></script>
<script src="/resource/assets/js/amazeui.min.js"></script>
<script src="/resource/assets/js/app.js"></script>
</body>
<script>
    var ue = UE.getEditor('content');
</script>
<style>
    #content{
        width: 100%;
    }
</style>
</html>